import React from "react";
import Style from './index.less'
import MyProfileItem from "@/pages/m/MyProfileItem";
import {Image, NavBar} from "antd-mobile";
import {useModel} from "@umijs/max";
import {CustomTabs} from "@/pages/m/CustomTabs";

const MyProfile: React.FC = ()=> {
  const { initialState } = useModel('@@initialState');
  // @ts-ignore
  const { currentUser } = initialState;

  return(
    <>
      <NavBar
        back={"返回"}
        style={{position: 'fixed', top: 0, left: 0, width: '100%', zIndex: 9999, backgroundColor: '#f5f5f5'}}
        onBack={()=>history.back()}
      >
        <div style={{fontSize: 16}}>个人设置</div>
      </NavBar>
      <div className={Style.body}>
        <div className={Style.header}>
          <div className={Style.profileHeader}>
            <div className={Style.profileAvatar}>
              <Image
                src={currentUser?.avatar}
                style={{width: 80, height: 80}}
              />
            </div>
            <div>
              <b style={{fontSize: 28}}>{currentUser?.name}</b>
              <p className={Style.profileTitle}>SG极简流水账</p>
            </div>
          </div>
        </div>
        <div className={Style.content}><MyProfileItem/><div style={{height: 60}} /></div>
      </div>
      {/*页脚导航*/}
      <CustomTabs/>
    </>
  )
};
export default MyProfile;
